package com.itheima01.day05;

/**
 * @author 刘全
 * @date 2021/7/5
 */
/*
需求：使用方法重载的思想，设计比较两个整数是否相同的方法，兼容全整数类型（byte,short,int,long）
 */
public class MethodTest04 {
    public static void main(String[] args) {
        byte a = 10, b = 20;
        boolean x = compare(a, b);
        if (x == true) {
            System.out.println("相同");
        } else {
            System.out.println("不相同");
        }
    }

    public static boolean compare(byte a, byte b) {
        return a == b;
    }

    public static boolean compare(short a, short b) {
        return a == b;
    }

    public static boolean compare(int a, int b) {
        return a == b;
    }

    public static boolean compare(long a, long b) {
        return a == b;
    }
}
